Genesus Config - Substrate node template - no account balances - substrate

I am learning substrate and just upgraded to the latest version 3.0.
I have a fresh instance of the Substrate node template - using Substrate 3.0 and Frame 2.0 from GitHub.
I have built the library
I am starting the node template with
./target/release/node-template --dev --tmp
the node starts fine creates blocks etc all looks fine.
I then go to Polkadot.js.org/app and the usual accounts we are used to seeing are there Alice Bob etc and a few stash accounts.
but all of the accounts have zero balance.
I cannot figure out how to set the account balances to non zero so that I can at least send transactions between accounts and I cannot figure out which Genesis block config is being used in chain_spec.rs as none of the account listings link up with the accounts shown in the polkadot.js app.
I am guessing that the config being used is this one since the accounts match the listing in the Polkadot.js app
The comment says prefunded accounts but I see no code to prefund them and I have no idea how to prefund them. With the previous version of the substrate-note-template the accounts where always just preloaded from the start.
I cannot even figure out which genesis config is being used as the accounts do not balance with any of these.
This is the closest but the Polkadot.js does not show the Charlie_Stash, Dave_Stash, Eve_Stash and Ferdie Stash accounts only the Alice and Bob Stash accounts are shown wherease this config has all Stash accounts for all of them.
pub fn local_testnet_config() -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm binary not available".to_string())?;
Ok(ChainSpec::from_genesis(
// Name
"Local Testnet",
// ID
"local_testnet",
ChainType::Local,
move || testnet_genesis(
wasm_binary,
// Initial PoA authorities
vec![
authority_keys_from_seed("Alice"),
authority_keys_from_seed("Bob"),
],
// Sudo account
get_account_id_from_seed::<sr25519::Public>("Alice"),
// Pre-funded accounts
vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Charlie"),
get_account_id_from_seed::<sr25519::Public>("Dave"),
get_account_id_from_seed::<sr25519::Public>("Eve"),
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
true,
),
// Bootnodes
vec![],
// Telemetry
None,
// Protocol ID
None,
// Properties
None,
// Extensions
None,
))
}[![enter image description here][1]][1]

Navigate to Polkadot js app's /#/settings/developer.
Paste the following custom type JSON in Setting > Developer >
{"AccountInfo": "AccountInfoWithDualRefCount"}

Related

How to update minted NFTs maxSupply to avoid 'none"?

A couple of months ago, I used Metaplex Storefront to mint NFTs.
Back in the day, Storefront didn't allow creators to specify the parameter maxSupply.
Max Supply: (Optional) The maximum number of times NFTs can be printed from this Master Edition. When set to None, the program will enable unlimited prints. You can disable NFT printing by setting the Max Supply to 0.
Source: Metaplex Docs
So today, the Master Edition account doesn't include this parameter.
Some marketplaces refuse to list these NFTs as a unique Master Edition as the max supply field is not defined (set to 'none' by default). Is there a way for me to fix that for my previously minted NFTS?
"edition": {
"type": "MasterEdition",
"supply": "0"
}
It's not possible to update maxSupply after the NFT is minted.
Because max supply is undefined, the NFT is considered an open edition.
More information here.

Rate limit exceeded - only used on one computer

I'm getting an error with Plaid that my rate limit has been exceeded, since I have 5 items in use on my developer account. I have only used Plaid on my localhost from my browser, and the quickstart app to look up my actual accounts. I'm confused how it thinks these are new systems - and also how to release one of these items so it frees up developer slots. The documentation says I can hit the release route, but that that doesn't restore an item slot.
Is there anything I'm missing?
{
"display_message": null,
"documentation_url": "https://plaid.com/docs/?ref=error#rate-limit-exceeded-errors",
"error_code": "ADDITION_LIMIT",
"error_message": "addition limit exceeded for this client_id. contact support to increase the limit.",
"error_type": "RATE_LIMIT_EXCEEDED",
"request_id": "#####",
"suggested_action": null
}
Ah yes you are not the first person to be confused by this! You need to request access to Development via the Plaid dashboard, which, once approved, will unlock access to 95 additional Items. You can do this here: https://dashboard.plaid.com/overview/development
The number of computers you are using doesn't matter, the only thing being counted is Items -- each Item takes up one slot, but in Development deleting Items does not free up slots.

G Suite Users:get and Users:list resources are not updated at the same time

I am currently using the G Suite Admin SDK API to retrieve user data. I want to check how long it takes for the user properties/fields to update.
After some checks I have realized that the User resources provided by the APIs Users:get and Users:list are not updated at the same time (I have checked this and I can tell that there is at least an offset of several minutes).
Is this the expected behaviour?
In order to reproduce this issue you can do as follows:
Choose a Google user of your own.
Log into the user account (log out first if you are already logged in)
Check the API results for Users:get and Users:list. Specifically look for the lastLoginTime parameter value.
The expected lastLoginTime value should be:
"2020-05-22T10:09:04.000Z"
However, this is what I get:
For Users:list:
"lastLoginTime": "2020-05-21T09:25:33.000Z",
For Users:get:
"lastLoginTime": "2020-05-22T10:09:04.000Z",
Thanks.

People API - QUOTA_EXCEEDED / FBS quota limit exceeded

The google people api page says correctly how to authenticate and list 10 example contacts and everything works perfectly:
https://developers.google.com/people/quickstart/python
I can authenticate and list 10 perfectly but I'm having an error when trying to create new contacts.
The api is returning me the following error:
HttpError: <HttpError 429 when requesting https://people.googleapis.com/v1/people:createContact?alt=json returned "Resource has been exhausted (e.g. check quota).". Details: "[{'#type': 'type.googleapis.com/google.rpc.QuotaFailure', 'violations': [{'subject': 'QUOTA_EXCEEDED', 'description': 'FBS quota limit exceeded.'}]}]">
when i click on https://people.googleapis.com/v1/people:createContact?alt=json, i have the following json on page:
{
"error": {
"code": 403,
"message": "The request is missing a valid API key.",
"status": "PERMISSION_DENIED"
}
}
I changed the scopes perfectly, even creating contacts a few months ago.
Out of nowhere everything stopped working and I'm having trouble QUOTA_EXCEEDED and FBS quota limit exceeded
I redid the entire authentication process and even tried to list contacts and without problems, everything works perfectly LESS the creation of contacts
Some observations:
I use via jupyter notebook and I'm also logged in to the email where
I want to create the contacts
I've tried to run in an IDE and the same problem
I've created 26888 contacts this way
This project does not appear on the Google console because I think I
did the entire project through documentation page, and I believe that the quotas have not been exhausted, just because I can see the values ​​correctly. I create on average 1 contact every 3 seconds and 200 contacts per day (maximum)
I would like a lot of help to know why I can't create more contacts, I have a lot of work pending because of that, thanks.
my code to create contacts:
def main():
creds = None
# The file token.pickle stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
if os.path.exists('token.pickle'):
with open('token.pickle', 'rb') as token:
creds = pickle.load(token)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(
'credentials.json', SCOPES)
creds = flow.run_local_server(port=0)
# Save the credentials for the next run
with open('token.pickle', 'wb') as token:
pickle.dump(creds, token)
service = build('people', 'v1', credentials=creds)
#----------------creatingc contacts----------------------
print('trying')
for i in df_banco_linhas[:2]:
if i[1] not in df_csv_linhas:
time.sleep(3)
service.people().createContact( body={
"names": [
{
"givenName": i[0]
}
],
"phoneNumbers": [
{
'value': i[1]
}
]
}).execute()
print('create: ' + i[0])
time.sleep(3)
else:
print('NO')
if __name__ == '__main__':
main()
As the problem was only happening when creating contacts, I decided to investigate the limit on the number of contacts and I came across the limit of 25000 in the documentation.
I was forced to create another email to solve the problem and increase my capacity to 50000 contacts (synchronizing two emails).
Their error message denotes that the problem is in the quota limit (requests), when in fact it is limit of contacts by email.
I was getting this same quota limit exceeded error ("FBS quota limit exceeded.") for a different reason. I was supplying values too long for the Organization.jobDescription field.
Perhaps this specific quota limit triggers when some non-rate constraints are violated, like total number of emails or maximum length of fields.
This may not be intended, since that kind of violation doesn't fit the 429 status code, and that limit is not listed in the Quotas section of the API/Service Details page for the People API in the console.

How to share location in a group with glympse rest api

I am trying to share my location to a card with following steps:
create a ticket with API /users/self/create_ticket
set the card_id of the ticket with API /tickets/:id/append_data
share ticket to a card with API /cards/:id/ticket, invite_code: random string like pUsl_79rB
append location into the ticket whit API /tickets/:id/append_location
Then I retrieve card members with API /cards/:id?members=true, I can see the ticket just created and shared to the card.
But the problem is that the invite_code is always "00" like following:
"ticket": {"invite_code": "00", "ticket_id": "160064993", "created_time": 1506573004818}
With invite_code "00", no one can get the location I shared.
Please help.
thanks.
You need to create invite code for the ticket created in step 1). So your step 1.1) would involve calling `POST tickets/:id/create_invite?type=link'. This will provide you with the code that goes to the card in step 3).

Resources