polymeshassociation / polymesh Goto Github PK
View Code? Open in Web Editor NEWNode for Polymesh Blockchain
Home Page: https://polymesh.network/
License: GNU General Public License v3.0
Node for Polymesh Blockchain
Home Page: https://polymesh.network/
License: GNU General Public License v3.0
Later:
3) Run tests on CI
4) Use CircleCI's parallelism to speed up tests.
Right now Polymesh produces several screenfulls of warnings when building, which is distracting when fishing for an error message. Most of the warnings are easy to fix and can be resolved with cargo-fix
in one go.
Ideally I'd like to have a tests folder that contains the unit tests for each module which can be run individually or all together and this would be ran by the CI tool on each PR.
Dumping some discussion notes for new contracts pallet here.
deposit = storage_used_before - storage_used_after
There's a barebones Capped STO which needs:
I am new to polymesh. I have downloaded the binary and started a dev node. I am able to connect to the dev node using polymesh explorer. But polyx transfer does not work.
Following is the error message:
system.ExtrinsicFailed
balances.ReceiverCddMissing
Attaching screenshots
How do i fix this issue? Please help.
Implementation details here: https://paper.dropbox.com/doc/Adding-Compliance-Token-to-Polymath-Finance--AdvE_O_4YlgN8cSiK0DpocxWAg-oLStxVR2gn2pCaP4XmfbD
List of tasks:
On dividends, I am moving towards a view that doing a "transfer accounting" method rather than using snapshots might be cleaner and more applicable. "transfer accounting" can manage lots of small dividends and moves the cost more towards an ongoing model rather than a large gas cost to pay out the dividend. By "transfer accounting" I mean approaches like:
https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
https://github.com/Roger-Wu/erc1726-dividend-paying-token/tree/master/contracts
Thoughts? I think we should retain snapshot functionality for things like governance, but possibly support both methods for dividends / capital distribution.
NB - not aiming to de-railing the current dividend approach which can use snapshots, but just putting this out there for future tasks.
As I've recently found it's possible to directly access other modules' public storage and methods. Pasting my instructions from Slack:
pub InvestorList get(investor_list): map T::AccountId => Investor<T::AccountId>;
InvestorList
above from identity
use crate::identity::InvestorList;
<InvestorList<T>>::get(some_key)
, for testing replace T
with Test
As a simple base, let's create a new module ERC20 that any account can just use to create a token with an initial supply.
Unlike Ethereum, state changes done during a transaction in substrate are NOT reverted if we throw an error at a later stage during a transaction.
This means we can't do state changes in verify transfer function and expect them to be reverted if some other TM reverts the tx at a later stage.
One way to avoid the problem is to have separate verify and execute transfer functions.
In each transfer, all TM will first be called with verify transfer function and if the result is that the transfer should go through, all TM must then be called with execute transfer function so that they can make the required state changes with a guarantee that they don't need to revert these changes.
I don’t understand why the number of coins is growing, but you yourself are lowering the price of your cryptocurrency. How many coins will your cryptocurrency grow to?
Hi, I tried to call substrate.get_events, but the data I got could not be decoded successfully. Is there any special type? I am currently referring to https://github.com/ PolymeshAssociation/Polymesh/blob/develop/polymesh_schema.json
Btw, the polkadot.js.org could not display block details which has transfer event like me: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fmainnet-rpc.polymesh.network#/explorer/query/4921857
Hey 👋
I would like to contribute to the polymesh project. What are some good first issues?
As an Issuer,
I want to distribute dividends to my investors,
So that I can provide them with the incentives for their investment.
AC
Issuer should be able to:
It would be better if you provide release builds for different versions to run nodes. It's hard to follow every new version and build from scratch.
I juts need to interact with Polymesh Network.
Thank you.
One thing we could improve here is to not Err() on the first restriction that is failed but propagate errors as they are found so we show a concatenated string of errors that were encountered during execution. Say 3 restrictions are in place of which 2 would fail, would be nice to show both errors in a single call.
Hi there!
I was looking through some of your contracts and noticed that you're still using ink! 3.x.
We released ink! 4.0 recently and it would probably be worth your time to update. We wrote a migration guide to help out.
Read data from event logs, Substrate.
Write script that fetches all past events for a particular module.
when I start the polymesh alcyone node it crashes and I get the following errors
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.593 main INFO polymesh::command Reserved nodes: []
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner Polymesh Node
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner ✌️ version 2.0.0
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner ❤️ by Anonymous, 2017-2020
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner 📋 Chain specification: Polymesh Alcyone Testnet
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner 🏷 Node name: pathrock
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner 👤 Role: AUTHORITY
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner 💾 Database: RocksDb at /root/.local/share/polymesh/chains/alcyone/db
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner ⛓ Native runtime: polymesh-2000 (polymath-polymesh-0.tx1.au1)
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.649 main INFO sub-libp2p 🏷 Local node identity is: 12D3KooWJkY8di7yUCLhrNVwPoxm26fbEEoaZBW6SbNdX3QxipKo (legacy representation: QmSkJyXwgs5NBzqVndL55xsQSZsBNzan3QNmFpcDteqFmJ)
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.659 main INFO sc_service::builder 📦 Highest known block at #1008
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.660 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os 〽️ Prometheus server started at 127.0.0.1:9615
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.664 main WARN sc_service Unable to bind RPC server to 0.0.0.0:9933. Trying random port.
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.673 main WARN sc_service Unable to bind RPC server to 127.0.0.1:9944. Trying random port.
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.676 main INFO babe 👶 Starting BABE Authorship worker
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.678 tokio-runtime-worker ERROR sub-libp2p 📪 Libp2p listener () closed: Address already in use (os error 98)
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: ====================
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: Version: 2.0.0
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 0: sp_panic_handler::set::{{closure}}
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 1: std::panicking::rust_panic_with_hook
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: at /rustc/d6953df14657f5932270ad2b33bccafe6f39fad4/src/libstd/panicking.rs:530
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 2: std::panicking::begin_panic
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 3: frame_executive::Executive<System,Block,Context,UnsignedValidator,AllModules,COnRuntimeUpgrade>::execute_block
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 4: <polymesh_runtime_testnet::runtime::Runtime as sp_api::runtime_decl_for_Core::Core<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32,sp_runtime::traits::BlakeTwo256>,sp_runtime::generic::unchecked_extrinsic::UncheckedExtrinsic<<pallet_indices::Module<polymesh_runtime_testnet::runtime::Runtime> as sp_runtime::traits::StaticLookup>::Source,polymesh_runtime_testnet::runtime::Call,sp_runtime::MultiSignature,(frame_system::extensions::check_spec_version::CheckSpecVersion<polymesh_runtime_testnet::runtime::Runtime>,frame_system::extensions::check_tx_version::CheckTxVersion<polymesh_runtime_testnet::runtime::Runtime>,frame_system::extensions::check_genesis::CheckGenesis<polymesh_runtime_testnet::runtime::Runtime>,frame_system::extensions::check_mortality::CheckMortality<polymesh_runtime_testnet::runtime::Runtime>,frame_system::extensions::check_nonce::CheckNonce<polymesh_runtime_testnet::runtime::Runtime>,frame_system::extensions::check_weight::CheckWeight<polymesh_runtime_testnet::runtime::Runtime>,pallet_transaction_payment::ChargeTransactionPayment<polymesh_runtime_testnet::runtime::Runtime>,pallet_permissions::StoreCallMetadata<polymesh_runtime_testnet::runtime::Runtime>)>>>>::execute_block
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 5: sp_api::runtime_decl_for_Core::execute_block_native_call_generator::{{closure}}
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 6: std::thread::local::LocalKey::with
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 7: sc_executor::native_executor::WasmExecutor::with_instance::{{closure}}
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 8: sc_executor::wasm_runtime::RuntimeCache::with_instance
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 9: <sc_executor::native_executor::NativeExecutor as sp_core::traits::CodeExecutor>::call
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 10: sp_state_machine::StateMachine<B,H,N,Exec>::execute_aux
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 11: sp_state_machine::StateMachine<B,H,N,Exec>::execute_using_consensus_failure_handler
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 12: <sc_service::client::call_executor::LocalCallExecutor<B,E> as sc_client_api::call_executor::CallExecutor>::contextual_call
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 13: <sc_service::client::client::Client<B,E,Block,RA> as sp_api::CallApiAt>::call_api_at
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 14: sp_api::runtime_decl_for_Core::execute_block_call_api_at
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 15: sp_api::Core::execute_block_with_context
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 16: <&sc_service::client::client::Client<B,E,Block,RA> as sp_consensus::block_import::BlockImport>::import_block
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 17: <sc_finality_grandpa::import::GrandpaBlockImport<BE,Block,Client,SC> as sp_consensus::block_import::BlockImport>::import_block
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 18: <sc_consensus_babe::BabeBlockImport<Block,Client,Inner> as sp_consensus::block_import::BlockImport>::import_block
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 19: sp_consensus::import_queue::import_single_block_metered
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 20: <futures_util::future::poll_fn::PollFn as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 21: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 22: <futures_util::future::future::Then<Fut1,Fut2,F> as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 23: <futures_util::future::poll_fn::PollFn as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 24: <sc_service::task_manager::prometheus_future::PrometheusFuture as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 25: <futures_util::future::select::Select<A,B> as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 26: <core::future::from_generator::GenFuture as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 27: std::thread::local::LocalKey::with
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 28: futures_executor::local_pool::block_on
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 29: tokio::loom::std::unsafe_cell::UnsafeCell::with_mut
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 30: std::panicking::try
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 31: tokio::runtime::task::harness::Harness<T,S>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 32: tokio::runtime::blocking::pool::Inner::run
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 33: tokio::runtime::context::enter
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 34: std::sys_common::backtrace::__rust_begin_short_backtrace
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 35: core::ops::function::FnOnce::call_once{{vtable.shim}}
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 36: <alloc::boxed::Box as core::ops::function::FnOnce>::call_once
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: at /rustc/d6953df14657f5932270ad2b33bccafe6f39fad4/src/liballoc/boxed.rs:1081
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: <alloc::boxed::Box as core::ops::function::FnOnce>::call_once
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: at /rustc/d6953df14657f5932270ad2b33bccafe6f39fad4/src/liballoc/boxed.rs:1081
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: std::sys::unix::thread::Thread::new::thread_start
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: at /rustc/d6953df14657f5932270ad2b33bccafe6f39fad4/src/libstd/sys/unix/thread.rs:87
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 37: start_thread
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 38: __clone
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: Thread 'tokio-runtime-worker' panicked at 'InvalidTransaction custom error', /rustc/d6953df14657f5932270ad2b33bccafe6f39fad4/src/libstd/macros.rs:13
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: This is a bug. Please report it at:
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: https://github.com/PolymathNetwork/polymesh/issues/new
have you got a fix for this?
For manual testing new features I find myself always repeating the same steps:
Currently, the code style is very inconsistent. Especially the indentation being used.
We should decide on a standard style. I recommend using https://github.com/rust-lang/rustfmt
Ideally TMs would implement a trait TransferManager with a function verifyTransfer
. The token would have a list of TM managers to loop through and call verifyTransfer
for each TM.
I pulled master branch command
cargo build --release
Got following error.
Compiling sp-consensus-babe v0.8.0-alpha.3 (https://github.com/paritytech/substrate?rev=a439a7aa5a9a3df2a42d9b25ea04288d3a0866e8#a439a7aa)
error[E0424]: expected value, found module `self`
--> /Users/achiko/.cargo/git/checkouts/substrate-7e08433d4c370a21/a439a7a/frame/support/src/traits.rs:763:11
|
761 | / bitmask! {
762 | | /// Reasons for moving funds out of an account.
763 | | #[derive(Encode, Decode)]
| | ^^^^^^ `self` value is a keyword only available in methods with a `self` parameter
764 | | pub mask WithdrawReasons: i8 where
... |
779 | | }
780 | | }
| |_- this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
For more information about this error, try `rustc --explain E0424`.
**error: could not compile `frame-support`.**
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
After connecting from Polymesh SDK getting following error in terminal :
....
2020-10-03 21:11:00 Unknown error: Client(UnknownBlock("State already discarded for BlockId::Hash(0x12fddc9e2128b3fe571e4e5427addcb87fcaf08493867a68dd6ae44b406b39c7)"))
Screen attached:
Client Code :
const polyClient = await Polymesh.connect({
nodeUrl: "ws://<my node ip>:9944",
accountSeed: seed,
});
console.log(
"Block Number : - ",
new BigNumber(await polyClient.getLatestBlock()).toNumber()
);
API returned response correctly but getting this message :
RPC-CORE: getStorage(key: StorageKey, at?: BlockHash): StorageData:: -32603: Unknown error occurred: Client(UnknownBlock("State already discarded for BlockId::Hash(0x12fddc9e2128b3fe571e4e5427addcb87fc
Screen :
I watch POLYX USDT and see that the number of Circulating supply coins is growing every day, thereby the price of the cryptocurrency is falling. I would like to know when new coins will stop being issued or existing ones will be burned so that the price of cryptocurrency will rise and not fall?
Hi Team!
Since many protocols are putting BLS12 to use for digital signatures.
I want to verify BLS 12 based signature from the Polymesh smart contract.
Hoping for some positive inputs/response on this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.