On NEAR, how to delete all keys other than the FullAccess key that my Ledger seed phrase created - nearprotocol

I want to delete all keys other than the FullAccess key that my Ledger seed phrase created.
When I check which keys are associated with my NEAR Ledger account, I see some like:
"access_key": {
"nonce": "aaaaaaaa",
"permission": {
"FunctionCall": {
"allowance": "0",
"method_names": [
"__wallet__metadata"
],
"receiver_id": "bbbbbbbbbbbbbbbb"
}
}
},
"public_key": "ed25519:cccccccccccccc"
}
(fake values above)
I tried:
NEAR_ENV=mainnet near delete-key bbbbbbbbbbbbbbbb cccccccccccccc --useLedgerKey
Make sure to connect your Ledger and open NEAR app
Deleting key cccccccccccccc on bbbbbbbbbbbbbbbb.
Waiting for confirmation on Ledger...
An error occured
DisconnectedDeviceDuringOperation: Cannot write to hid device
at new CustomErrorClass
What should I have done instead?
Also, note that someone should fix "occured" to "occurred".

There may have been an issue with USB connectivity.
The command in this syntax:
NEAR_ENV=mainnet near delete-key bbbbbbbbbbbbbbbb cccccccccccccc --useLedgerKey
did indeed work when the Ledger was plugged directly into my laptop (rather than into a USB switch connected to my laptop) and was logged in with its NEAR app open.
Oddly, it made me confirm the public key of its FullAccess key 3 times before then also (unsurprisingly) making me confirm the deletion of the cccccccccccccc key.
But it worked!
Now when I run NEAR_ENV=mainnet near keys bbbbbbbbbbbbbbbb, I see just the FullAccess key, so I've achieved my goal.
(Note that in my question and in this answer, I've replaced real values with fake ones.)
UPDATE:
Actually, when running NEAR_ENV=mainnet near send xxxxxxx yyyyy 1 --useLedgerKey, even when plugged directly into my laptop, I got this error:
Waiting for confirmation on Ledger...
An error occured
Error
at new TransportError ...
But then I ran it again, and it worked, although it again weirdly made me confirm the public key of its FullAccess key 3 times before then also (unsurprisingly) making me confirm the transfer. So I don't know what the root cause of either issue was, but trying multiple times seems to have been an effective enough workaround.

Related

Metaplex - Canceling an (English) Auction made by Auctioneer

I have a question about canceling auctions in the Metaplex’s Auction House.
I’m currently creating an Auction with the following instruction:
const accounts = {
auctionHouseProgram,
listingConfig,
wallet,
tokenAccount,
metadata,
authority,
auctionHouse,
auctionHouseFeeAccount,
sellerTradeState,
freeSellerTradeState,
auctioneerAuthority,
ahAuctioneerPda,
programAsSigner
};
const args {
tradeStateBump,
freeTradeStateBump,
programAsSignerBump,
auctioneerAuthorityBump,
tokenSize,
startTime,
endTime,
reservePrice,
minBidIncrement,
timeExtPeriod,
timeExtDelta,
allowHighBidCancel,
}
Auctioneer.createSellInstruction(acounts, args);
Is there any way to cancel a listed auction of this type?
I know that other types of listings such as AuctionHouse.createSellInstruction (https://github.com/metaplex-foundation/metaplex-program-library/blob/master/auction-house/js/src/generated/instructions/sell.ts) do have a Cancel Instruction, and I’ve used them before.
But how can I cancel the English Auction type? Is it even possible? Like, what if I accidently made an Auction last for years, or put a wrong Listing Configuration value?
All Cancel instructions take as an argument the buyerPrice. But in this case there is no buyerPrice, it rather uses reservePrice.
I've tried to pass the buyerPrice as 18446744073709551615 to try to execute the Auctioneer.createCancelInstruction, which is the same buyerPrice value I used to create the TradeState for listing it. But I get the following error:
2: "Program log: AnchorError caused by account: token_account. Error Code: AccountOwnedByWrongProgram. Error Number: 3007. Error Message: The given account is owned by a different program than expected."
3: "Program log: Left:"
4: "Program log: 11111111111111111111111111111111"
5: "Program log: Right:"
6: "Program log: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
Also...
Is it possible to create a ListingReceipt for this type of
listing? I want to keep track of creation date, canceled date, etc.
When an Auction for an item has ended and failed to bid cause no bidders or any other reason, if I try to list it again for another auction I get: Address { address: GkX7ZE4sz6mtvueoWT6KGpjZLUd3wkohy3ha3VZNh2Fz, base: None } already in use So I believe cancelation is needed. Cause now it’s on a weird unknown status where Auction has ended due to time constraints and Token cannot be listed again.
You can cancel your listing Using THIS.
You can you normal listing receipts of AH for this as well.
The previous account should be closed in order to create a new listing. In order to close that account you need to cancel listing or the Nft should be sold.

Google.apis returns error code 400 after creating maximum amount of service account keys

We are using Google.apis Version 1.36.1 SDK in order to create service account keys for GCP Service accounts.
When we reach maximum amount of keys (10) instead of getting a valid error message / error code we recieve a general 400 error code with a "Precondition check failed." message.
We used to get error code 429 indicating we have reached maximum amount of keys.
Current GoogleApiException object :
Google.GoogleApiException: Google.Apis.Requests.RequestError
Precondition check failed. [400]
Errors [
Message[Precondition check failed.] Location[ - ] Reason[failedPrecondition] Domain[global]
]
The current return code does not provide us with enough information, Is there any other way for us to know the reason of the failure ?
This error message is also related to limits. You can take the official documentation for the Classroom API as an example.
I have found myself in a similar situation where we were deleting service account keys to immediately create new ones. We were getting the same error because there is a delay on the system where it can take from 60-90 seconds to delete the key for you to be able to create it again.

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.

How do you transfer tokens from the lockup contract using the CLI?

If tokens were locked using a lockup contract (docs) what is the process for using the CLI to transfer those tokens once they have reached their unlocking time, either fully or partially?
Before the lockup is fully unlocked, you can call a method transfer on the contract, for example:
near call <yourlockup>.lockup.near transfer '{"amount": "1000000000000000000000000000", "receiver_id": "<receiver_account_id>"}' --accountId=<youraccount> --networkId=mainnet --nodeUrl=https://rpc.mainnet.near.org --gas=200000000000000 --useLedgerKey
Once it is fully unlocked, you can also add a full access key by invoking add_full_access_key with {"new_public_key": "<base58 key>"}, and convert your lockup account into a regular account.
There is a step by step guide here, also includes steps related to stake/unstake:
https://github.com/near/core-contracts/tree/master/lockup#staking-flow
The key steps after unstaking and withdrawing are:
near call lockup1 refresh_staking_pool_balance '{}' --accountId=owner1 --gas=75000000000000
near view lockup1 get_liquid_owners_balance '{}'
near call lockup1 check_transfers_vote '{}' --accountId=owner1 --gas=75000000000000
near call lockup1 transfer '{"amount": "10000000000000000000000000", "receiver_id": "owner-sub-account"}' --accountId=owner1 --gas=50000000000000

SNMPv3 user entries got deleted after reboot on SNMPv3 machine

After reboot on our SNMPv3 server SNMPv3 user entries get deleted from file /var/net-snmp/snmpd.conf.
It appears on doing reboot engineBoots is set to 1 in /var/net-snmp/snmpd.conf randomly and whenever engineBoot is set to 1 it erases snmpv3 user entries from snmpd.conf file.
Firstly, I want to understand why engineBoots vaule is randomly set to 1, As per standard snmp document , this EngineBoots should be incremented every time we do reboot or EngineTime exceeded the max value.
Secondly, we want to figure out the correlation of engineBoots vaule setting to 1 and the deletion of usmUser entries in /var/net-snmp/snmpd.conf.
Thanks-Ravi
It is normal behavior. Once snmpd is restarted, the create user command line will be deleted from /var/net-snmp/snmpd.conf for security reason and the user will be created in usmUsertable.

Resources