the 'hello' sample in eos tutor is not working - eos

Following the instruction in eos dev website:
https://developers.eos.io/eosio-home/docs/your-first-contract
first of all, this process stuck forever:
eosio-cpp -o hello.wasm hello.cpp --abigen
then I found api generated so break the process.
broadcast the contract to the blockchain is not working either:
cleos create account eosio hello EOS75sYBXG6jw89qdsGhcpb6EmLastWwqkEE3n2LbLDz3A94FRobQ -p eosio#active
It complains:
mutable globals cannot be imported: globalImport.type.isMutable
Anyone came across this and how to solve?
Thanks.

Create new account on cleos using -
cleos create account eosio hello EOS75sYBXG6jw89qdsGhcpb6EmLastWwqkEE3n2LbLDz3A94FRobQ EOS75sYBXG6jw89qdsGhcpb6EmLastWwqkEE3n2LbLDz3A94FRobQ
Prior to that import the associated private key(EOS75sYBXG6jw89qdsGhcpb6EmLastWwqkEE3n2LbLDz3A94FRobQ) in the wallet using
cleos wallet import --private-key

Related

No job show up in Runs page while trying to run a Chainlink node locally

I am trying to fulfil requests on my local test chainlink node on rinkeby (following https://docs.chain.link/docs/fulfilling-requests/) but can't see any job runs appear on my operator ui.
The Oracle contract is at 0xA66f738a4688A9E51c2c6FF901CC3B11ce31AE6C
The ATestnetConsumer contract is at 0x977129EE2f404F4327A2A60C5fD9E57890D85FD0
My job toml screenshot below
Have confirmed my .env that it is running the rinkeby wss url from infura and the chain is 4 and the link token contract address is 0x01BE23585060835E02B77ef475b0Cc51aA1e0709
My node wallet has ETH and LINK. Both the contracts have Link too (but no ETH).
I run the setFulfillmentPermission function in remix with my Node wallet address and true
When I execute the requestEthereumPrice function with my oracle address and job id, I can see the LINK being sent by the ATestnetConsumer contract to the Oracle contract but no job run gets created in my local Chainlink node.
Confirming that the job hasn't run, I get the 0 value when I run the currentPrice function on ATestnetConsumer.
Can anyone please point me to where I am going wrong? Thanks in advance!
Finally got it to work. Posting my two findings as I do think the documentation needs an update to account for these.
The external job id in the Jobs screen on the Operator UI has dashes in them. To use them in the ATestnetConsumer contract you need to remove the dashes (so 0e84f38985eb4edb98c2e2a09b589666 and not 0e84f389-85eb-4edb-98c2-e2a09b589666).
The direct request toml doesn't seem to work as is. I had to append allowunrestrictednetworkaccess="true" to the fetch section so it becomes
fetch [type="http" method=GET url="$(decode_cbor.get)" allowunrestrictednetworkaccess="true"]

Requesting airdrop of 1 SOL on the devnet

I have properly setup a Solana wallet on the devnet, using these commands:
curl https://release.solana.com/v1.8.6/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\solana-install-tmp\solana-install-init.exe --create-dirs
C:\solana-install-tmp\solana-install-init.exe v1.8.6
solana-keygen new --outfile C:/Users/Usermame/.config/solana/devnet.json
solana config set --keypair C:/Users/Usermame/.config/solana/devnet.json
solana config get
And it successfully created a Solana wallet. However, when I ran:
solana airdrop 1
It said:
Requesting airdrop of 1 SOL
Error: unable to confirm transaction. This can happen in situations such as transaction expiration and insufficient fee-payer funds
I have successfully airdropped 1 SOL to a Solana wallet on a devnet before, I don't know why this is not working.
Can anyone help me with this please?
Thank you!
Sometimes the devnet runs out of the faucets due to some dev asking for more than required faucets.
Have ran into same problem many times now.
One such instance was highlighted by core-contributor on the community group.
SOLUTION:
Either you can wait for validators to mint new faucets
OR
Ask for faucet in discord. That should do.
As mentioned before, sometimes the devnet is out; however, that is also just a potential message you get when the devnet(or any net) is down as well. You can ask in the server; otherwise, you can try other networks like the test network or deploying locally in the meantime.

What is proper cmd. line invocation of the EOS cmd. "cleos set contract?"

From the documentation at https://developers.eos.io/eosio-cpp/docs/token-tutorial:
cleos set contract eosio.token build/contracts/eosio.token -p eosio.token#active
But from the documentation at https://developers.eos.io/eosio-cleos/reference#cleos-set-contract:
set contract (below are parameters:)
Positional Parameters:
account TEXT - The account to publish a contract for
wast-file TEXT - The file containing the contract WAST or WASM
abi-file TEXT - The ABI for the contract
So which is it? I'm confused b/c the documentatin is inconsistent.
Documentation is outdated. You can run cleos set contract help to see latest docs. It would result to:
account — the account to publish a contract for.
contract-dir — contract directory.
wast-file — the file containing the contract WAST or WASM.
abi-file — the ABI of the contract.
Also, if your wast/abi files have the same name as folder, you my specify only contract-dir.
"How to Create and Deploy Your Own EOS Token" might be helpful.

What is the "eosio" account re:EOS blockchains?

When configuring and installing an EOS blockchain, you're required to use the "eosio" account as the block producing account or blocks aren't signed. I haven't been able to find much info. however about this pseudo account as it appears to come w/the software by default.
From EOSIO documentation, the "eosio" account is an authorizing account, used to bootstrap EOSIO nodes. But is it stored someplace, or just the default "root" account for EOS blockchains?
You even use this account to create new accounts.
My question is, where is its private key? Is this the key set in the genesis.json file? Can I use another account to configure my blockchain? I would imagine so b/c you specify it at the cmd. line, otherwise the parameter wouldn't be needed.
I'm just frustrated by the lack of documentation surrounding EOS and kindly request help from the community.
UPDATE: 7/13/2018
I changed the "producer-name" to another value but then the blockchain doesn't sign transactions and it sits idle. This is why I'm confused about "eosio." Its key is configured in the config.ini but it doesn't appear that you can change the "producer-name," which is fine, but then why have a "-p" cmd. line parameter? It's just not making sense to me.
its private key is stored at config.ini
# Tuple of [public key, WIF private key] (may specify multiple times) (eosio::producer_plugin)
private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
The second value is the private key.
In addition I think that you can use another account to configure your blockchain . EOSIO is just the testing account .
So i suppose that you can use another block producer if you use another producer name and account with different keys at config.ini
Check this : https://medium.com/coinmonks/test-4fbd38fdc4e8 chapter 4

No Eth for accounts of private network of `truffle develop`?

I'm developing a Solidity program. I started truffle develop
> truffle develop
Truffle Develop started at http://localhost:9545/
Accounts:
(0) 0x627306090abab3a6e1400e9345bc60c78a8bef57
(1) 0xf17f52151ebef6c7334fad080c5704d77216b732
(2) 0xc5fdf4076b8f3a5357c5e395ab970b5b54098fef
(3) 0x821aea9a577a9b44299b9c15c88cf3087f3b5544
(4) 0x0d1d4e623d10f9fba5db95830f7d3839406c6af2
(5) 0x2932b7a2355d6fecc4b5c0b6bd44cc31df247a2e
(6) 0x2191ef87e392377ec08e7c08eb105ef5448eced5
(7) 0x0f4f2ac550a1b4e2280d04c21cea7ebd822934b5
(8) 0x6330a553fc93768f612722bb8c2ec78ac90b3bbc
(9) 0x5aeda56215b167893e80b4fe645ba6d5bab767de
Mnemonic: candy maple cake sugar pudding cream honey rich smooth crumble sweet treat
truffle(develop)> migrate
Using network 'develop'.
Running migration: 1_initial_migration.js
Replacing Migrations...
... 0x3bfa69d31cbe12e43f20204daaf24e764a084ade586c3b417099d2e2deccc8eb
Migrations: 0x8cdaf0cd259887258bc13a92c0a6da92698644c0
Saving successful migration to network...
... 0xd7bc86d31bee32fa3988f1c1eabce403a1b5d570340a3a9cdba53a472ee8c956
Saving artifacts...
Running migration: 2_deploy_contracts.js
Replacing TutorialToken...
... 0x56fb0c0933ee395055db66976427f050e24dadda018b113d8f0cc03dc7229043
TutorialToken: 0x345ca3e014aaf5dca488057592ee47305d9b3e10
Saving successful migration to network...
... 0xf36163615f41ef7ed8f4a8f192149a0bf633fe1a2398ce001bf44c43dc7bdda0
Saving artifacts...
truffle(develop)>
Then I setup MetaMask to connect the Private network of http://localhost:9545/. However, I cannot do any transaction because the MetaMask account has 0 ETH? How to add some test ETH for development?
Update
I realized that the account created by metamask has different addresses than the ten test accounts created by truffle develop. How to import the test account into Metamask?
When you setup Metamask you have to import the existing account (I can't remember the exact wording of the option, but you'll figure it out) and then provide the mnemonic Truffle gave you: candy maple cake sugar pudding cream honey rich smooth crumble sweet treat.
Instead of importing the Truffle test accounts into Metamask, you can start Truffle with a predefined set of test accounts using the --account option. Just specify your private key and the amount of Wei you want to start with.
testrpc --account
"YOUR_PRIVATE_KEY,300000000000000000000"
This will initialize your account with 300 ether. Note that you have to pass in your key, not the address.
You can specify multiple accounts with separate --account options.
Instead of importing testrpc/ganache-cli accounts to metamask, you can start testrpc/ganache-cli giving the metamask's mnemonic seed.
Here's how to do it :
Open metamask
click on the burger menu on the top-right corner of the pop-in
Metamask main pop-in
Choose reveal seed word at the bottom of the settings pop-in
Metamask option bottom pop-in
Enter your password. Seed words should been revealed then. Copy/paste them somewhere safe.
When launching testrpc, here's what you can use :
Here's what i use :
testrpc -m "<seed words>"
if you use ganache-cli, which is the new version of testrpc, that's the same :
ganache-cli -m "<seed words>"
This is what i personally use :
ganache-cli -b 15 --debug -m "<seed words>"
-b 15 means i want 15 second block time. I put this to have some delay as on the main net. When deploying your contracts and making requests you won't have instant answer. If you want you can put decrement this number if you want some delay but not wait too much.
--debug will allow you to have some more information like the assembly instructions made when making a call. It can be useful to know what fails or where the contract instructions stops.
After you run Truffle develop and the console prints out the 10 accounts along with the private keys, copy one of the accounts private keys then go to Metamask > Import Account > Select Type = Private Key then past the copied private key in and then you should see the account with ETH in it.
Note: All 10 accounts should have 100 Eth except the first that used a small amount of Eth to bootstrap the chain.