用于Rust的EOSIO SDK –用于在Rust中的EOSIO区块链上构建智能合约的API
项目地址:
https://github.com/sagan-software/eosio-rust
开发文档:
https://sagan-software.github.io/eosio-rust/quick-start.html
您正在查看: Surou 发布的文章
EOSIO SDK for Rust
ubuntu 18.04 编译安装 russellcoin
安装依赖
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install g++ git automake
udo apt-get install autoconf make libtool pkg-config libqt4-network libqtgui4
sudo apt-get install libboost-all-dev git libdb++-dev libssl-dev
clone & 编译
cd
git clone https://github.com/russellcoinpay/russellcoin.git
cd russellcoin
./autogen.sh
cd depends
make -j`nproc`
cd ..
./configure --prefix=`pwd`/depends/x86_64-unknown-linux-gnu --disable-tests --with-gui=no
make
异常
由于当前链代码依赖得qt版本为4.6.4,当前系统gcc 和 g++ 较高版本时,会导致语法错误
qmap.h:509:45: error: value-initialization of incomplete type ‘char []’
node = node_create(d, update, akey, T());
解放方法,gcc和g++降级到4.8
gcc 降级4.8
sudo apt-get install gcc-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100
sudo update-alternatives --config gcc
gcc --version
g++ 降级4.8
sudo apt-get install g++-4.8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 100
sudo update-alternatives --config g++
g++ --version
根本解决
参考anoncoin 升级qt为5.7.1版本
参考
https://anoncoin.github.io/How_to_build_Anoncoin_from_source/
https://www.cnblogs.com/in4ight/p/6626708.html
https://github.com/Anoncoin/anoncoin/issues/26
EOS离线下载块历史数据地址
The archive consists of state, blocks, and state-history archives, plus a copy of a portable snapshot made by EOS Sweden on the day prior to the snapshop. This should help if your environment is different. The archives are made with eosio_1.8.1-1-ubuntu-18.04_amd64.deb Debian package.
区块链私钥管理开源库- a blockchain private key management library
https://github.com/consenlabs/token-core-android
https://github.com/consenlabs/token-core-ios
String prvKey = WalletManager.exportPrivateKey(ethereumWallet.getId(), SampleKey.PASSWORD);
System.out.println(String.format("PrivateKey: %s", prvKey));
String mnemonic = WalletManager.exportMnemonic(ethereumWallet.getId(), SampleKey.PASSWORD).getMnemonic();
System.out.println(String.format("Mnemonic: %s", mnemonic));
String json = WalletManager.exportKeystore(ethereumWallet.getId(), SampleKey.PASSWORD);
System.out.println(String.format("Keystore: %s", json));
// output:
// PrivateKey: f653be3f639f45ea1ed3eb152829b6d881ce62257aa873891e06fa9569a8d9aa
// Mnemonic: tide inmate cloud around wise bargain celery cement jungle melody galaxy grocery
// Keystore: {"id":"c7575eba-3ae3-4cc3-86ba-2eb9c6839cad","version":3,"crypto":{"ciphertext":"7083ba3dd5470ba4be4237604625e05fa6b668954d270beb848365cbf6933ec5","mac":"f4f9ea8d42ff348b11fc146c396da446cc975309b3538e08a58c0b218bddd15d","cipher":"aes-128-ctr","cipherparams":{"iv":"db3f523faf4da4f1c6edcd7bc1386879"},"kdf":"pbkdf2","kdfparams":{"dklen":32,"c":10240,"prf":"hmac-sha256","salt":"0ce830e9f888dfe33c31e6cfc444d6f588161c9d4128d4066ee5dfdcbc5d0079"}},"address":"4a1c2072ac67b616e5c578fd9e2a4d30e0158471"}
EOS合约内unpack data
void myaction() {
struct token_transfer {
name from;
name to;
asset quantity;
string memo;
};
// transaction is inside "prop" object (that we get from a eosio.msig table)
eosio::multisig::proposals proptable( "eosio.msig"_n, proposer.value );
auto& prop = proptable.get( proposal_name.value, "proposal not found" );
// get the first action in the transaction, remember transactions can have multiple actions
eosio::action my_action = eosio::unpack<eosio::transaction>( prop.packed_transaction ).actions.front();
// get the data out of the action
token_transfer my_action_data = my_action.data_as<token_transfer>();
const name from = my_action_data.from;
const name to = my_action_data.to;
const asset quantity = my_action_data.quantity;
const string memo = my_action_data.memo;
}
参考
https://eosio.stackexchange.com/questions/4142/how-to-get-data-from-a-packed-transaction
最新回复
fzd: 请问这个解决了吗
StarkWare explained: layer 2 solution provider of dYdX and iMMUTABLE R11; BitKeep News: [...]Layer 2: https://...
一文读懂 StarkWare:dYdX 和 Immutable 背后的 L2 方案 R11; BitKeep 博客: [...]Layer 2:Comparing Laye...
http://andere.strikingly.com/: Regards, Great stuff!
surou: 需要先执行提案合约申请,等待出块节点地址同意后,才会进...
heco: WARN [11-19|11:26:09.459] N...
P: 你好,我在heco链上遇到了“tx fee excee...
Peng: 楼主安装成功了吗?我正在同步区块链,一天了,差不多才同...
joyhu: 你好,请问下安装好之后如何获取到bee.yaml配置文...
kaka: 支票最终怎么提币呢?
归档
April 2025March 2025February 2025January 2025December 2024November 2024October 2024September 2024August 2024July 2024June 2024May 2024April 2024March 2024January 2024December 2023November 2023October 2023September 2023August 2023July 2023June 2023April 2023March 2023February 2023January 2023December 2022November 2022October 2022August 2022July 2022June 2022May 2022March 2022February 2022January 2022December 2021November 2021October 2021September 2021August 2021July 2021June 2021May 2021April 2021March 2021February 2021January 2021December 2020November 2020October 2020September 2020July 2020June 2020May 2020April 2020March 2020February 2020January 2020December 2019November 2019October 2019September 2019August 2019July 2019June 2019May 2019April 2019March 2019February 2019January 2019December 2018November 2018October 2018September 2018August 2018July 2018June 2018